package com.founder.gateway.component.transport.sentinel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.founder.gateway.component.transport.netty.NettyServer;

@Configuration
@ConditionalOnClass(NettyServer.class)
@ConditionalOnProperty(value = "sentinel.enabled")
@ConfigurationProperties(prefix = "sentinel")
public class SentinelServer {
	private static final Logger logger = LoggerFactory.getLogger(SentinelServer.class);
	public static String groupId;
	public static String address;
	public void setGroupId(String groupId) {
		SentinelServer.groupId = groupId;
	}
	public void setAddress(String address) {
		SentinelServer.address = address;
	}
	public void start() {
//		 InitExecutor.doInit();
//		 ClusterStateManager.setToClient();
		 logger.info("sentinel started on address: {}  ->groupId: {}",address,groupId);
	}
	public void stop() {
	}
}
